<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Classes extends CI_Controller {

	public function index() { }

	public function getClasses() {
		$this->load->model('Model_class');
		$cursor = $this->Model_class->getClasses();
		$cursor->sort(array('class'=>1));
		$arr = array();

		foreach (iterator_to_array($cursor) as $class) {
			array_push($arr, $class);
		}
		echo json_encode($arr);
	}

	public function getMenu($class) {
		$this->load->model('Model_class');
		$cursor = $this->Model_class->getMenu($class);
		// $cursor->sort(array('class'=>1));
		echo json_encode($cursor);
	}
}

?>